﻿#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int a[N], b[N];
int main()
{
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i]; // 1 2 2 1 2 1
        b[i] = a[i] - a[i - 1];      //构建差分数组
        /*
        b[1] = a[1] - a[0] = 1-0=1
        b[2] = a[2] - a[1] = 2-1=1
        b[3] = a[3] - a[2] = 2-2=0
        b[4] = a[4] - a[3] = 1-2=-1
        b[5] = a[5] - a[4] = 2-1=1
        b[6] = a[6] - a[5] = 1-2=-1
        */
    }
    int l, r, c;
    while (m--)
    {
        cin >> l >> r >> c;
        b[l] += c;     //将序列中[l, r]之间的每个数都加上c
        b[r + 1] -= c;

        // l=1 r=3 c=1  b[1]=b[1]+1=1+1=2   b[4]=b[4]-1=-2
        // l=3 r=5 c=1  b[3]=b[3]+1=0+1=1   b[6]=b[6]-1=-2
        // l=1 r=6 c=1  b[1]=b[1]+1=2+1=3   b[7]=b[7]-1=0
        //计算完成最后的结果：b[3,1,1-2,1,-2]
    }
    for (int i = 1; i <= n; i++)
    {
        a[i] = b[i] + a[i - 1];    //前缀和运算
       /*
        a[1]=b[1]+a[0]=3+0=3;
        a[2]=b[2]+a[1]=1+3=4;
        a[3]=b[3]+a[2]=1+4=5;
        a[4]=b[4]+a[3]=-2+5=3;
        a[5]=b[5]+a[4]=1+3=4;
        a[6]=b[5]+a[5]=-2+4=2;
        */
        cout << a[i];   //3 4 5 3 4 2
    }
    system("pause");
    return 0;
}